package com.ywu.application.standard.dataSource.api;

import com.ywu.common.result.CommonResult;
import com.ywu.application.standard.dataSource.dto.YwuDataExecDto;
import com.ywu.application.standard.dataSource.dto.YwuDataExecParamQueryDto;
import com.ywu.application.standard.dataSource.dto.YwuDataExecVersionDto;
import com.ywu.application.standard.dataSource.service.YwuDataExecService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName YwuDataExecApi
 * @Description TODO
 * @Author GroundDemo
 * @Date 2024/10/31 17:45
 * @Version 1.0
 **/
@RestController
@RequestMapping("/ywu/data/exec")
public class YwuDataExecApi {
    @Autowired
    private YwuDataExecService service;

    /**
    * @Author GroundDemo
    * @Description 创建执行服务
    * @Date 18:01 2024/10/31
    * @Param [ywuDataExecDto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/create.data.exec.info")
    public CommonResult<Object> createDataExec(@RequestBody YwuDataExecDto ywuDataExecDto) {
        return service.createDataExec(ywuDataExecDto);
    }

    /**
    * @Author GroundDemo
    * @Description 修改执行服务
    * @Date 18:02 2024/10/31
    * @Param [ywuDataExecDto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/update.data.exec.info")
    public CommonResult<Object> updateDataExec(@RequestBody YwuDataExecDto ywuDataExecDto) {
        return service.updateDataExec(ywuDataExecDto);
    }

    /**
    * @Author GroundDemo
    * @Description 删除执行服务
    * @Date 18:03 2024/10/31
    * @Param [ywuDataExecDto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/delete.data.exec.info")
    public CommonResult<Object> deleteDataExec(@RequestBody YwuDataExecDto ywuDataExecDto) {
        return service.deleteDataExec(ywuDataExecDto);
    }

    /**
    * @Author GroundDemo
    * @Description 分页查询执行服务
    * @Date 18:04 2024/10/31
    * @Param [ywuDataExecDto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/query.data.exec.info.page")
    public CommonResult<Object> queryDataExecPageList(@RequestBody YwuDataExecDto ywuDataExecDto) {
        return service.queryDataExecPageList(ywuDataExecDto);
    }

    /**
    * @Author GroundDemo
    * @Description 发布数据
    * @Date 21:48 2024/10/31
    * @Param [ywuDataExecDto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/publish.data.exec.info")
    public CommonResult<Object> publishDataExec(@RequestBody YwuDataExecDto ywuDataExecDto) {
        return service.publishDataExec(ywuDataExecDto);
    }

    /**
    * @Author GroundDemo
    * @Description 执行脚本
    * @Date 13:44 2024/11/20
    * @Param [ywuDataExecVersionDto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/data.exec.info")
    public CommonResult<Object> dataExec(@RequestBody YwuDataExecVersionDto ywuDataExecVersionDto) {
        return service.dataExec(ywuDataExecVersionDto);
    }

    /**
     * @Author GroundDemo
     * @Description 调试字段查询
     * @Date 16:05 2024/11/20
     * @Param [ywuDataExecVersionDto]
     * @return com.ywu.common.result.CommonResult<java.lang.Object>
     **/
    @PostMapping("/query.data.exec.param.info")
    public CommonResult<Object> queryExecDebugParam(@RequestBody YwuDataExecVersionDto ywuDataExecVersionDto) {
        return service.queryExecDebugParam(ywuDataExecVersionDto);
    }

    /**
     * @Author GroundDemo
     * @Description 调试字段查询
     * @Date 16:05 2024/11/20
     * @Param [ywuDataExecVersionDto]
     * @return com.ywu.common.result.CommonResult<java.lang.Object>
     **/
    @PostMapping("/query.data.exec.param.info.new")
    public CommonResult<Object> queryExecDebugParamNew(@RequestBody YwuDataExecParamQueryDto ywuDataExecParamQueryDto) {
        return service.queryExecDebugParamNew(ywuDataExecParamQueryDto);
    }
}
